<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_SESSION['onemerchurl']){
	exi('','',$_SESSION['onemerchurl']);
}
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid']);
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 15;
	$total='';
	$return['merchgroups']=pdo_getslice('jy_merch_category',$params,array($pindex,$psize),$total,$fields,'','id desc');
	$return['basic']['searchkeyword']=$return['basic']['searchkeyword']?explode('|',$return['basic']['searchkeyword']):array();
	$return['list']=array();
	$merch_types=$this->merch_types2;
	$return['merch_types']=array();
	foreach($merch_types as $k=>&$mv){
		$childs=pdo_getall('jy_merch_category',array('type'=>$k,'uniacid'=>$_SESSION['uniacid']));
		$return['merch_types'][]=array(
				'id'=>$k,
				'title'=>$mv,
				'childs'=>$childs,
		);
	}
	$snsid=intval($_RQ['id']);
	if(!$snsid){
		exi('请选择小区进入！','error','/index/');
	}
	$return['sns']=pdo_get('jy_merch_sns',array('uniacid'=>$_SESSION['uniacid'],'id'=>$snsid));
	$return['params']=array('cid'=>intval($_RQ['cid']),'snsid'=>$snsid);
	set_html('title',$return['sns']['title'].'-商户列表');
	exi($return);
}
?>